package com.marry.multidatasource.controller;

import com.marry.multidatasource.model.TableResItem;
import com.marry.multidatasource.model.bd.Pledgeinfo;
import com.marry.multidatasource.service.PledgeinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ml
 * @create 2018-01-09--11:31
 */
@RestController
public class PledgeinfoController {

    @Autowired
    private PledgeinfoService pledgeinfoService;

    @RequestMapping("/getPledgeinfoListByRealeunum")
    public TableResItem getPledgeinfoListByRealeunum(String realeunum){
        TableResItem item=new TableResItem();
        List<Pledgeinfo> pledgeinfoList= pledgeinfoService.getPledgeinfoListByRealeunum(realeunum);
        item.setCount(pledgeinfoList.size());
        item.setData(pledgeinfoList);
        item.setCode(0);
        item.setMsg("");
        return item;


    }
}
